<?php
require_once("conf/db_connection.php");

$equi_size = $_GET['size'];
$equip_type = $_GET['type'];
$preferred_trucker = $_GET['trucker'];

$query_suggest = "SELECT * FROM truck WHERE equipment_size='".trim($equi_size)."' AND equipment_type='".trim($equip_type)."' AND is_available='1' ORDER BY available_date_time LIMIT 0,1";
$result_suggest = mysql_query($query_suggest) or die("SELECT SUGGESTION ".mysql_error());
$row_suggest = mysql_fetch_array($result_suggest);

$id = $row_suggest['id'];
$plate = strtoupper($row_suggest['plate']);
$equipment_size = $row_suggest['equipment_size'];
$equipment_type = $row_suggest['equipment_type'];
$contact_person = $row_suggest['contact_person'];
$contact_position = $row_suggest['contact_position'];
$contact_cellphone = $row_suggest['contact_cellphone'];
$fleet_group = $row_suggest['fleet_group'];
$ownership = $row_suggest['ownership'];

echo "new Array(\"$id\",\"$plate\",\"$equipment_size\",\"$equipment_type\",\"$contact_person\",\"$contact_position\",\"$contact_cellphone\",\"$fleet_group\",\"$ownership\")";
?>